package com.hngy.xpq.android_practice.assets;

import android.content.Context;
        import android.graphics.Typeface;
        import android.widget.TextView;

public class XpqIcoMoonUtils {
    public static Typeface IOC;

    public static Typeface getIOC(final Context context) {
        if (IOC == null)
            IOC = getTypeface(context,"ico.ttf");
        return IOC;
    }

    public static void setIOC(final TextView... textViews) {
        if (textViews == null || textViews.length == 0)
            return;
        Typeface typeface = getIOC(textViews[0].getContext());
        for (TextView textView : textViews)
            textView.setTypeface(typeface);
    }

    private static Typeface getTypeface(final Context context,final String name) {
        return Typeface.createFromAsset(context.getAssets(),name);
    }
}
